package com.auth.domain.service;

import com.auth.sdk.LoginInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.auth.control.model.UserDto;
import com.auth.domain.module.po.authmanage.User;
import com.auth.domain.module.vo.authmanage.RoleAuthsVo;
import com.auth.domain.module.vo.authmanage.UserAuthVo;
import com.auth.domain.module.vo.authmanage.UserVO;

import java.util.List;

/**
 * User service
 *
 * @description:
 * @author: cyj
 * @date 2020 -10-21 20:46:33
 */
public interface IUserService extends IService<User> {

    /**
     * Gets by login id *
     *
     * @param loginId login id
     * @return the by login id
     * @description: 根据logId查询用户
     */
    public User getByLoginId(String loginId);

    /**
     * Gets auth *
     *
     * @param id id
     * @return the auth
     * @description: 根据user表id获取用户所有权限及角色信息
     */
    UserAuthVo getAuth(Long id);

    /**
     * Assemble role auths list
     *
     * @param id id
     * @return the list
     * @description: 根据user表loginId组装用户所有权限及角色信息,有必要可以改成表连接
     */
    List<RoleAuthsVo> assembleRoleAuths(Long id);

    IPage<UserVO> pageCommon(Page page);

    UserVO saveUser(UserDto userDto);

    UserVO updateUser(UserDto userDto);

    UserVO selectUser(Long id);

    UserVO selectUser(String loginId);

    UserVO deleteUser(Long id);

    String authenticationIn(String loginId, String pwd);

    void authenticationOut(String id, String token);

    LoginInfo authenticationInfo(String token);
}
